import { request } from "@/utils/request"

// 用户登录
export const userLogin = (account, password) => request({
	url: `user/login`,
	method: "POST",
	data:{
		account,
		password
	}
})
export const updateUserInfo = (postdata) => request({
	url: `user/updateUserInfo`,
	method: "POST",
	data:postdata
})


export const applyAccountCancellation = (postdata) => request({
	url: `user/applyAccountCancellation`,
	method: "POST",
	data:postdata
})
/**
 * 验证码登录
 * @param{string} funtype login=>登录,register=>注册,changemobile=>修改手机号,resetpwd=>重置密码
 */
export const sendMobileVerificationCode = (mobile, funtype) => request({
	url: `user/sendMobileVerificationCode`,
	method: "POST",
	data:{
		mobile,
		funtype
	}
})

export const getUserInfo = (funtype) => request({
	url: `user/getUserinfo`,
	method: "GET",
	params:{
		funtype
	}
})

// 获取个人中心菜单配置
export const getUserMenuConfig = (modulex) => request({
	url: `user/getUserMenuConfig`,
	method: "GET",
	params:{
		modulex
	}
})

// 验证码登录
export const userMobileLogin = (mobile, captcha) => request({
	url: `user/mobilelogin`,
	method: "POST",
	data:{
		mobile,
		captcha
	}
})

// 申请成为师傅
export const applyMasterWorker = (data) => request({
	url: `user/postApplyUser`,
	method: "POST",
	data
})


// 申请师傅审核状态
export const getApplyMasterWorkerDetails = (mobile = "", id) => request({
	url: `user/getApplyUserDetails`,
	method: "POST",
	params: {
		mobile,
		id
	}
})

// 重置密码
export const resetUserPassword = (data) => request({
	url: `user/resetpwd`,
	method: "POST",
	data
})

// 修改手机号
export const updateUserMobile = (data) => request({
	url: `user/changemobile`,
	method: "POST",
	data
})

// 分享码
export const getShareCode = () => request({
	url: `user/getSceneDetails`,
	method: "GET"
})

// 当月日期休息数据
export const getUserMonthDate = (month) => request({
	url: `Holiday/getUserMonthDateConfig`,
	method: "GET",
	params:{
		month
	}
})
// 设置休息
export const postSetDate = (data) => request({
	url: `Holiday/postSetDate`,
	method: "POST",
	data
})
// 取消休息
export const postCancel = (data) => request({
	url: `Holiday/postCancel`,
	method: "POST",
	data
})
// 加班记录
export const getOverTime = (data) => request({
	url: `overtime/getUserPaginate`,
	method: "GET",
	data
})
// 加班记录详情
export const OverTimeDetails = (data) => request({
	url: `overtime/getDetails`,
	method: "GET",
	data
})
// 修改加班记录
export const editOverTime = (data) => request({
	url: `overtime/postEdit`,
	method: "POST",
	data
})
// 删除加班记录
export const delOverTime = (data) => request({
	url: `overtime/postDelete`,
	method: "POST",
	data
})
// 公司任务
export const getTasks = (data) => request({
	url: `Resorttasks/getUserPaginate`,
	method: "GET",
	data
})
// 接任务
export const postTask = (data) => request({
	url: `resorttasks/postTaskOrder`,
	method: "POST",
	data
})
// 公司任务--详情
export const getTaskDetails = (data) => request({
	url: `Resorttasks/getDetails`,
	method: "GET",
	data
})

// 获取认证信息
export const getUserPermit = (data) => request({
	url: `/Workerdata/getUserPermit`,
	method: "GET",
	data
})
// 提交认证信息
export const postUserPermit = (data) => request({
	url: `/Workerdata/postUserPermit`,
	method: "POST",
	data
})
